from django.db import models

# Create your models here.
class Tongoo(models.Model):
    emision = models.DateField()
    lugar   = models.CharField(max_length=20)
    nombre  = models.CharField(max_length=50)
    season  = models.CharField(max_length=3)
    episodio= models.CharField(max_length=3)

    def __unicode__(self):
        return '%s%s %s'%(self.season, self.episodio, self.nombre)



class Tag(models.Model):
    tag    = models.CharField(max_length=20)

    def __unicode__(self):
        return self.tag



class Categoria(models.Model):
    categ  = models.CharField(max_length=25)
#    descr  = models.CharField(max_length=100)

    def __unicode__(self):
        return self.categ



class Link(models.Model):
    url    = models.URLField()
    title  = models.CharField(max_length=10)
    desc   = models.TextField()
    mark   = models.TimeField()

    def __unicode__(self):
        return self.title



class Nota(models.Model):
    links   = models.ManyToManyField(Link)
    tags    = models.ManyToManyField(Tag)
    categs  = models.ManyToManyField(Categoria)
    fecha   = models.DateTimeField(auto_now=True)
#   desc    = models.TextField()
    image   = models.FilePathField(blank=True)
    tongoo  = models.ForeignKey('Tongoo')
    PUNTAJE_CHOICES = (
        ('0', '0'),
        ('1', '1'),
        ('2', '2'),
        ('3', '3'),
        ('4', '4'),
        ('5', '5'),
        ('6', '6'),
        ('7', '7'),
        ('8', '8'),
        ('9', '9'),   )
    puntaje = models.CharField(max_length=1, choices=PUNTAJE_CHOICES)

    def __unicode__(self):
        return '%s %s'%(self.fecha, self.tongoo)



class Usuario(models.Model):
    #nota    = models.ForeingKey('Nota')
    pass


# class tongueame(models.Model):
#    fecha
#    nombre
#    usuario
#    votes puntajes
#    tags
#    comentarios
#
